<?
define("COMPONENT", basename(__DIR__));
define("JS", TRUE);
$javascript = array("respond", "orientationfix", "modernizr");

// header
require_once("../global/header.php");

function strip_only($str, $tags, $stripContent = false) {
    $content = '';
    if (!is_array($tags)) {
        $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
        if (end($tags) == '')
            array_pop($tags);
    }
    foreach ($tags as $tag) {
        if ($stripContent)
            $content = '(.+</' . $tag . '[^>]*>|)';
        $str = preg_replace('#</?' . $tag . '[^>]*>' . $content . '#is', '', $str);
    }
    return $str;
}

function getHtmlComponente($file) {
    $html = file_get_contents($file);

    $html = strip_only($html, array("script", "link"));

    if (preg_match('~<body[^>]*>(.*?)</body>~si', $html, $body)) {
        echo $body[1];
    } else {
        echo "na";
    }
}
?>


<!-- BEGIN: <Template> --> 
<section class="nt_lasthour_main_01">

    <header class="main-header"><?php getHtmlComponente("../nav_header_01/index.html"); ?></header>

    <div class="nav-special">
        <?php getHtmlComponente("../nav_newsspecial_01/index.html"); ?>
    </div>

    <!-- BEGIN: <main> -->
    <div class="main">
        <div class="bannerTopNews">
            <?php getHtmlComponente("../ads_combo_01/index.html"); ?>
        </div>

        <div class="highlight"><?php getHtmlComponente("../nav_featured_01/index.html"); ?></div>

        <?php getHtmlComponente("../art_branch_01/index.html"); ?>

        <!-- BEGIN: <contenedor1> -->
        <div class="container-one">
            <div class="container-one-left">
                <?php getHtmlComponente("../art_20itemspag_01/index.html"); ?>
            </div>
            <div class="container-one-right">
                <div class="left2">
                    <?php getHtmlComponente("../btn_progr_01/index.html"); ?>
                </div>
                
                <div class="right2">
                    <div class="bannerNews1">
                        <img src="http://placehold.it/300x250" alt="Banner">
                    </div>
                </div> 

                <div class="container-full">
                    <?php getHtmlComponente("../btn_6prog_02/index.html"); ?>
                </div>
                
                <div class="c1r_4">
                	<?php getHtmlComponente("../wdg_nwslt_01/index.html"); ?>
                </div>

            </div>
        </div>
        <!-- END: <contenedor1> -->

    </div>
    <!-- END: <main> -->

    <!-- BEGIN: <footer> -->
    <footer class="footerVertical">
        <?php getHtmlComponente("../nav_bookmark_01/index.html"); ?> 
        <?php getHtmlComponente("../nav_footer_01/index.html"); ?>
        <?php getHtmlComponente("../nav_corft_01/index.html"); ?> 
    </footer>
    <!-- END: <footer> -->
</section>   
<!-- END: <Template> -->

<script type="text/javascript" src="http://comentarios.esmas.com/js/communities.js"></script>
<?
// footer
require_once("../global/footer.php");
?>